<link rel="stylesheet" href="../addons/jy_aligroup/custom/templates/mobile/css/style.css?v=2020" />
<style type="text/css">
.order_goods_img img {border: 1px solid rgb(215, 215, 215); border-image: none; width: 60px; height: 60px; display: block;}
.order_goods_price i {font-size: 9px;}
.order_goods_grab .order_goods_grab_txt {background: 0px 0px rgb(238, 51, 17); padding: 2px 3px; border-radius: 2px; color: rgb(255, 255, 255); display: inline-block;}
.tuan_g_price b {font-size: 18px; font-weight: 400; margin-right: 2px; margin-left: 5px;}
.tuan_g_price span {vertical-align: 1px;}
.order_status {height: 30px; color: rgb(221, 0, 0); line-height: 40px; float: left;}
.order_btn a {border-radius: 3px; width: 80px; height: 30px; text-align: center; color: rgb(255, 255, 255); line-height: 30px; margin-left: 5px; float: left; background-color: rgb(75, 75, 75); -webkit-border-radius: 3px;
}
#container{margin:0;background: none;}
.fui-list-angle span.text-danger{color: #ef4f4f;}
</style>
<div class='fui-page order-list-page'>
	<div class="jy2-headertopbg">
			<div class="fui-header" style="background:none">
				<div class="fui-header-left">
					<a class="back" style="color:#fff" href="javascript:" ng-click="goback()"></a>
				</div>
				<div class="title bold" style="font-size:1rem;color:#fff">我的团</div>
			</div>
	 </div>
	<div class="fui-tab fui-tab-danger jy2-headertop" id="tab" style="top:4.2rem">
		<a ng-class="{'external active':pagedata.status == 0}" href="javascript:" ng-click="tool.get_list('jy_aligroup/myteam/getlist/status=0',true);pagedata.status=0">组团中</a>
        <a ng-class="{'external active':pagedata.status == 1}" href="javascript:" ng-click="tool.get_list('jy_aligroup/myteam/getlist/status=1',true);pagedata.status=1">组团成功</a>
        <a ng-class="{'external active':pagedata.status == 2}" href="javascript:" ng-click="tool.get_list('jy_aligroup/myteam/getlist/status=2',true);pagedata.status=2">组团失败</a>
	</div>
    <div class='fui-content' style="padding-bottom:0;top:4.8rem;position: absolute;">
		<div class='fui-content-inner' ng-if="!pagedata.list || pagedata.list.length==0">
			<div class='content-empty'>
				<i class='icon icon-lights'></i><br/>暂时没有参加任何团
			</div>
			<div class="fui-according-group" id="container"></div>
		</div>
		<div ng-repeat="item in pagedata.list" class='lynn_order_item'>
			<div class="external">
				<div ng-if="item.order.id" class='lynn_order_title'>
					订单号: {{item.order.orderno}}
					<span ng-if="item.status==1" class="order_status" style="float:right;"> 团购已成功 </span>
					<span ng-if="item.status==0" class="order_status" style="float:right;"> 团购进行中 </span>
					<span ng-if="item.status==2" class="order_status" style="float:right;"> 团购已过期 </span>
				</div>
				<div class="fui-list lynn_order_list" style="background:#fff">
					<div class="fui-list-media">
						<img ng-src="{{tomedia(item.goods.image)}}" class="round">
					</div>
					<div class="fui-list-inner">
						<div class="lynn_order_list_title">{{item.groups.title}}</div>
						<div class="lynn_order_list_subtitle">{{item.groups.desc}}</div>
					</div>
					<div class='fui-list-angle'>
						<span class='marketprice text-danger'>¥{{item.goods.groupsprice}}</span>/{{item.units?item.goodsnum+item.units:'1件'}}<br/>
						x1
					</div>
					<div style="position: absolute;right: 4rem;top:3px;width:3rem;height: 3rem;z-index: 999;">
						<img ng-if="item.itemnum >= item.groupnum"  alt="" width="100%" height="100%" src="/addons/jy_aligroup/custom/templates/mobile/images/success.png"/>
						<img ng-if="item.itemnum < item.groupnum && item.success == 0"   alt="" width="100%" height="100%" src="/addons/jy_aligroup/custom/templates/mobile/images/fail.png"/>
					</div>
				</div>
				<div class='lynn_order_price'>
					<span class='status'>
						运费: <span class='text-danger'>¥{{item.goods.freight || 0}}</span>元, 共 <span class='text-danger'>1</span> 个商品
						总额: <span class='text-danger'>¥{{item.amount}}</span>元
					</span>
					<span class='r-f'>{{item.createtime}}</span>
				</div>
			</div>
			<div class='lynn_order_bottom'>
				<span class="status">
					<a ng-if="item.status==1" class="lynn_btn lynn_btn_danger" href="javascript:;" ng-click="access_json('jy_aligroup/goods//id='+item.goodid)">再拼一单</a>
					<a ng-if="item.order.id" class="external lynn_btn lynn_btn_danger" href="javascript:;" ng-click="access_json('jy_aligroup/teamdetail/detail/teamid='+item.id)">查看团详情</a>
					<a ng-if="!item.order.id && item.status==0" class="external lynn_btn lynn_btn_danger" href="javascript:;" ng-click="access_json('jy_aligroup/confirm//teamid='+item.id)">下单</a>
					<a ng-if="!item.order.id && item.status==2" class="external lynn_btn lynn_btn_cancel">未下单</a>
				</span>
			</div>
		</div>
	 </div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script>
scope.loading = true;  //状态标记
scope.isnodata = false;
//滚动加载
scope.tool.get_list('jy_aligroup/myteam/getlist/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_aligroup/myteam/getlist/status='+scope.pagedata.status);
}
</script>